<?php

function core_create() {

}

function core_read_prepare($uri) {
  $table_name = akh_get_recursive($uri, array('path', 'resource'));
  $params     = array_merge(
    rip_get_primary_key($table_name),
    akh_get($uri, 'query', array())
  );

  foreach ($params as &$param) {
    $param .= ' = ?';
  }

  return strtr('SELECT * FROM %{table_name} WHERE %{conditions}', array(
    '%{table_name}' => $table_name,
    '%{conditions}' => implode(' AND ', $params),
  ));
}

function core_read_exec($params) {

}

function core_update() {

}

function core_delete() {

}

